﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        Icon firsticon; // set by Form1_Load()
        int nl = 0;

        public Form1()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Icon = firsticon;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Form myform2 = new Form2();
            myform2.Icon = IDE_week2_Forms_project.Properties.Resources.icon_2;
            myform2.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Icon = IDE_week2_Forms_project.Properties.Resources.icon_1;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            firsticon = this.Icon;
           // ChangeLanguage("en");
        }

        private void ChangeLanguage(string l)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(l));
            }

        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (this.nl == 0)
            {
                ChangeLanguage("nl");
                nl = 1;
            }
            else
            {
                ChangeLanguage("en");
                nl = 0;
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }

    }
}
